<template>
	<view class="bg">
		<HeaderVue :title="name"></HeaderVue>
		<view v-html="content">
			
		</view>
	</view>
</template>

<script>
	import HeaderVue from '@/components/Header.vue'
	export default {
		components: {
			HeaderVue
		},
		data() {
			return {
				name:'',
				content:'',
				code:''
			}
		},
		onLoad(option) {
			this.name = option.name
			if(option.name=='用户协议'){
				this.code = 'yonghuxieyi'
			}else{
				this.code = 'yinsizhengce'
			}
			this.getData()
		},
		methods: {
			async getData() {
				var res = await this.$req({
					url:'api/system/get_article',
					data:{
						code:this.code
					}
				})
				if(res.code == 1) {
					this.content = res.data.content
				}else{
					uni.showToast({
						title:res.msg,
						icon:'none'
					})
				}
			},
		}
	}
</script>
<style>
	page{
		width: 100vw;
		height: 100vh;
		background: linear-gradient( 180deg, #FFB6C1 0%, #FCE5E5 100%);
	}
</style>
<style lang="scss" scoped>
	.bg{
		padding: 80rpx;
	}
</style>
